<template>
  <div class="dg-divider" :class="'dg-divider--' + type">
    <div class="dg-divider__text" :class="'is-' + position" >{{content}}</div>
  </div>
</template>

<script>
  export default {
    props: {
      type: {
        type: String,
        default: 'horizontal'
      },
      content: {
        type: String
      },
      position: {
        type: String,
        default: 'center'
      }
    }
  }
</script>
<style>
.dg-divider {
    background-color: #dcdfe6;
    position: relative;
}
.dg-divider--horizontal {
    display: block;
    height: 1px;
    width: 100%;
    margin: 24px 0;
}
.dg-divider__text.is-left {
    left: 20px;
    transform: translateY(-50%);
}
.dg-divider__text {
    position: absolute;
    background-color: #fff;
    padding: 0 20px;
    font-weight: 500;
    color: #303133;
    font-size: 14px;
}
.dg-divider__text.is-center {
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
}
.dg-divider__text.is-right {
    right: 20px;
    transform: translateY(-50%);
}

.dg-divider--vertical {
    display: inline-block;
    width: 1px;
    height: 1em;
    margin: 0 8px;
    vertical-align: middle;
    position: relative;
}

</style>
